package cn.xy.ymcc.feign;

import cn.xy.ymcc.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {
            @Override
            public User getByPhone(String phone) {
                return new User(-1l,"操作失败");
            }
        };
    }
}

